package com.candy.ob;

import java.io.Serializable;

public class Student implements Serializable {

    //序列化版本号，建议显示声明
    private static final long serialVersionUID=1L;

    //属性
    private int atuAge;
    private transient String stuName;
    private boolean stuSex;

    //无参构造
    public Student() {
    }

    //全参构造
    public Student(int atuAge, String stuName, boolean stuSex) {
        this.atuAge = atuAge;
        this.stuName = stuName;
        this.stuSex = stuSex;
    }

    //行为方法
    public void sayHi() {
        System.out.println("大家好");
    }

    //getter setter方法
    public int getAtuAge() {
        return atuAge;
    }

    public void setAtuAge(int atuAge) {
        this.atuAge = atuAge;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public boolean isStuSex() {
        return stuSex;
    }

    public void setStuSex(boolean stuSex) {
        this.stuSex = stuSex;
    }

    @Override
    public String toString() {
        return "Student{" +
                "atuAge=" + atuAge +
                ", stuName='" + stuName + '\'' +
                ", stuSex=" + stuSex +
                '}';
    }
}
